package com.ericsson.epc.modules.ebmAutoCollector.job;

import com.ericsson.common.quartz.job.MainJob;
import com.ericsson.common.quartz.job.ManualQuartzJob;
import com.ericsson.common.quartz.service.QuartzTableManager;
import com.ericsson.common.util.LogFileName;
import com.ericsson.common.util.LoggerUtils;
import com.ericsson.epc.modules.ebmAutoCollector.task.EbmAutoCollectorTask;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @description: ebm信令聚合功能
 * @author: wangjingshi
 * @create: 2021-02-20 15:54
 */
@Component
public class EbmAutoCollectorJob implements MainJob {

    private Logger log = LoggerUtils.Logger(LogFileName.EbmAutoCollectorJob);
    @Autowired
    private QuartzTableManager quartzTableManager;
    @Autowired
    private EbmAutoCollectorTask ebmAutoCollectorTask;
    @Value("${cron}")
    private String cron;

    @Override
    public void doTask() {
        log.info("===== do EbmAutoCollectorJob start ===== "+cron);
        quartzTableManager.addManualTaskJob("EbmAutoCollectorJob","EbmAutoCollectorJob",
                "EbmAutoCollectorJob","EbmAutoCollectorJob",
                ManualQuartzJob.class,cron,ebmAutoCollectorTask);
    }
}
